import store from '@/store'
export const imgerror = {
  inserted: function(el, options) {
    // console.log(el)
    el.onerror = () => {
      el.src = options.value
    }
  }
}
// 通过自定义指令，来操作按钮的权限
export const allow = {
  inserted: function(el, options) {
  // 获取到用户拥有的指令 从vuex中获取
    const points = store.state.user.userInfo.roles.points
    console.log(points)
    console.log(el)
    console.log(options)
    console.log(options.value)
    // 实现指令绑定对象的显示和隐藏
    if (!points.includes(options.value)) {
      el.style.display = 'none'
    }
  }
}

